import type { PageParams, PageResult } from '@/types/global'
import type { HotItem, BannerItem, CategoryItem, GuessItem } from '@/types/home'
import { http } from '@/utils/http'

/**
 * 首页-广告区域-轮播图
 * @param distributionSite 广告区域展示位置 1 为首页（默认值） 2 为商品分类页
 * @returns
 */
export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<BannerItem[]>({ method: 'GET', url: '/home/banner' })
}

/**
 * 获取首页分类数据
 * @returns
 */
export const getHomeCategoryAPI = () => {
  return http<CategoryItem[]>({ method: 'GET', url: '/home/category/mutli' })
}
/**
 * 首页-热门推荐-小程序
 * @returns
 */
export const getHomeHotAPI = () => {
  return http<HotItem[]>({ method: 'GET', url: '/home/hot/mutli' })
}

/**
 * 猜你喜欢API
 */
export const getGoodsGuessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({ method: 'GET', url: '/home/goods/guessLike', data })
}
